/*
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2024-09-10 20:53:55
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2024-09-11 10:38:15
 * @FilePath: \projecte:\学习\react\my-react-frameworke\src\setupProxy.js
 * @Description: 
 */
const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(
    '/api',
    createProxyMiddleware({
      target: 'http://localhost:3000',
      changeOrigin: true,
    })
  );
  // 配置多段跨域规则
  // app.use(
  //   '/use',
  //   createProxyMiddleware({
  //     target: 'http://localhost:3000',
  //     changeOrigin: true,
  //   })
  // );
};